command=$1
git_parmas=$2

fab_tool=/usr/local/python3/bin/fab
# fab_tool=fab

if [ "$command" == "-help" -o "$command" == "" ];then
        echo "功能（暂时不支持环境自动安装过程）(另外附上aws部署方案脚本aws_python_lambda)";
        echo "    -help: 获取帮助";
        echo "    -update_code : 更新项目代码(后面给git地址)";
        echo "    -aws_deploy : 将更新代码部署至亚马逊serverless(后面给项目名称)";
        echo "    -physic_deploy : 将更新代码部署至物理机(后面给项目名称)";
        echo "    -restart_physic_env : 重启项目服务(后面给项目名称)";
        echo "    -stop_physic_env : 终止项目服务(后面给项目名称)";
elif [ "$command" == "-update_code" ]; then
	${fab_tool} -f fabric_tool.py update_code:$2

elif [ "$command" == "-aws_deploy" ]; then
	${fab_tool} -f fabric_tool.py aws_deploy:$2

elif [ "$command" == "-physic_deploy" ]; then
	${fab_tool} -f fabric_tool.py physic_deploy:$2

elif [ "$command" == "-restart_physic_env" ]; then
	${fab_tool} -f fabric_tool.py restart_physic_env:$2

elif [ "$command" == "-stop_physic_env" ]; then
        ${fab_tool} -f fabric_tool.py stop_physic_env:$2

else
        echo "ERROR: 对不起，暂时不支持命令 $command, 请使用-help查看";

fi



